<?php
        $kw=mysqli_real_escape_string($conn,$_GET['kw']);
        $kw= htmlspecialchars($kw);
        $sql = "SELECT * FROM app where name like '%$kw%'";
        $rs = mysqli_query($conn, $sql);
        
        while($r = mysqli_fetch_assoc($rs)){
            
?>

<div class="item">
	<div class="item-icon">
    	<a alt="#" href="?mod=detail&idapp=<?php echo $r['id']?>"><img src="img/app/<?php echo $r['image']?>" /></a>
    </div>
    <div class="item-description">
        <span class="item-name"><?php if(   strlen($r['name']) > 20) echo substr($r['name'],0,19)."..."; else echo $r['name'];?></span><br/>
        <a class="item-download" href="<?php echo $r['link']?>">Download</a>
        <div class="srtgs" id="rt_app_<?php echo $r['id']?>"></div>
        <div class="info-wapper"><img src="img/ivers.png"/>&nbsp;<span><?php echo $r['version']?></span><img src="img/iview.png"/>&nbsp;<span><?php echo $r['view']?></span><img src="img/isize.png"/>&nbsp;<span><?php echo $r['size']?></span></div>
    </div>
</div>


<?php
	}
?>